package drds.common.db.xml_mapping.builder;

import drds.common.db.xml_mapping.mapping.BindSql;
import drds.common.db.xml_mapping.mapping.ParameterMapping;
import drds.common.db.xml_mapping.mapping.SqlSource;
import drds.common.db.xml_mapping.session.Configuration;

import java.util.List;


public class StaticSqlSource implements SqlSource {

  private final String sql;
  private final List<ParameterMapping> parameterMappings;
  private final Configuration configuration;


  public StaticSqlSource(Configuration configuration, String sql, List<ParameterMapping> parameterMappings) {
    this.sql = sql;
    this.parameterMappings = parameterMappings;
    this.configuration = configuration;
  }

  @Override
  public BindSql getBoundSql(Object parameterObject) {
    return new BindSql(configuration, sql, parameterMappings, parameterObject);
  }

}
